﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Windvoice.Albums;

namespace Windvoice.Controllers
{
    public class AlbumController : Windvoice.Framework.ControllerBase
    {
        //
        // GET: /Album/

        public ActionResult Index(int? page)
        {
            int PageIndex = page == null ? 1 : page.Value;
            int PageSize = 10,RecordCount = 0;
            ViewBag.Albums = Album.GetList(PageIndex,PageSize,out RecordCount);
            ViewBag.PageSize = PageSize;
            ViewBag.RecordCount = RecordCount;
            return View();
        }

        public ActionResult Detail(int id)
        {
            var album = Album.Find(id);
            if (album != null)
            {
                ViewBag.Photos = album.GetPhotoes();
                return View(album);
            }
            return View("_404");
        }
    }
}
